UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ovUXAraoldOeXknVTsgYzRgLlJG9jJX+U6VUj8wKJl4='
WHERE
key_id = 'fb97db7724e34b7590e9dda616b99c74b2f3b0d38e2b6100000be5a8ed5609f0'
AND (
token = 'ovUXAraoldOeXknVTsgYzRgLlJG9jJX+U6VUj8wKJl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)