UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fZleRnzLAJOmIi+A+i8xhOo/NXp+q1hJN+g1bKqCF6c='
WHERE
key_id = 'c6d887fa6fd5d90a26663b443268ada4b14763e5ef999adfbdeee9ee6a9063a1'
AND (
token = 'fZleRnzLAJOmIi+A+i8xhOo/NXp+q1hJN+g1bKqCF6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)