UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WKtlQ4+SnXl4mfaJGsOsWvVtSV8woN2pYHDkXFlV6yI='
WHERE
key_id = '2db5f06a095a6bba0b58b6a4780621bcdd99429829e290f7ba586509dc19e8c7'
AND (
token = 'WKtlQ4+SnXl4mfaJGsOsWvVtSV8woN2pYHDkXFlV6yI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)