UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oD44ICAvxWeWC6BtAaYbzmyI/t6CJdJpHf1QmH2cKKY='
WHERE
key_id = 'fb1eb7e9fc39a540f37088b45fcd783f9f5d2a0bdb829fa41771f80ebe45a838'
AND (
token = 'oD44ICAvxWeWC6BtAaYbzmyI/t6CJdJpHf1QmH2cKKY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)