UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OYDkcmgJA6oEkobi0ymfXOhHxrwaJc/mA00EMm5Bn94='
WHERE
key_id = '9c2ecc8a014dd4d28350b6ac758ea78c018cd90e7dbbad3d0b41740e655973a3'
AND (
token = 'OYDkcmgJA6oEkobi0ymfXOhHxrwaJc/mA00EMm5Bn94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)