UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fmowjmIlqUUYEvM58TmjSxql6903Z3Ij2/LMen61RnQ='
WHERE
key_id = 'ac390aed5d23b593d9cc8aa2a9d501167e06f91433fde2a93ccdd3c6d4722cee'
AND (
token = 'fmowjmIlqUUYEvM58TmjSxql6903Z3Ij2/LMen61RnQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)