UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hhIYwzgwnTr+h4NLzt6wTPHY1qqscn+3ViQ0JQzf6gE='
WHERE
key_id = '10973f44290f103b4247f341febddedc604c5f58171262c87e0457d9009a9985'
AND (
token = 'hhIYwzgwnTr+h4NLzt6wTPHY1qqscn+3ViQ0JQzf6gE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)