UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iks2giAXo8UazeSRQsvguwAAV513a/rRHp2V7oVFyqo='
WHERE
key_id = '61457f88c807d100738f70492411fbe9e627b5c36f34e8c1f9c94c1216e7ae62'
AND (
token = 'iks2giAXo8UazeSRQsvguwAAV513a/rRHp2V7oVFyqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)