UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TcRlVb5q+s0JFPWorWyqr2dYZsUEPdEz+n/Qa3wCFCY='
WHERE
key_id = 'e52319cbda7f3b91048d2b7905c7b6d0bcaa1813b4f90942e6cb475e6ecde3c5'
AND (
token = 'TcRlVb5q+s0JFPWorWyqr2dYZsUEPdEz+n/Qa3wCFCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)