UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BMICaf8f2DQ+QmmVGUWoMcQennHFDpfTxiUsn6Av37Y='
WHERE
key_id = '243b7ba41964d94dd01b05da2d1e6ad82441ff1fad1820d046937fb201ab3ebc'
AND (
token = 'BMICaf8f2DQ+QmmVGUWoMcQennHFDpfTxiUsn6Av37Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)