UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y2gZrTZvE0/FqeRJfgNVjA9e+uJuWkusUqZpzp/9KYQ='
WHERE
key_id = 'a25ae4811e9d0ff44741b1f63bc7e4a59d5207256ad149bd330594c643db231d'
AND (
token = 'Y2gZrTZvE0/FqeRJfgNVjA9e+uJuWkusUqZpzp/9KYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)