UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IUOJj9apjHJK5vl36xNLmU5JjHNOWEUOC9iuJHNr6bM='
WHERE
key_id = '5e2042c9f461969410e459d29af125207a40f67915ffd120ff9829a44879f110'
AND (
token = 'IUOJj9apjHJK5vl36xNLmU5JjHNOWEUOC9iuJHNr6bM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)