UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CVTqnMxZ2xb8XkrTdIEsfotp+5AA5PAZVVxnsiTjnSA='
WHERE
key_id = '9778b9014897d3648140e649b86db5c6b3a5b415c158967a3f8ab266585f6d2d'
AND (
token = 'CVTqnMxZ2xb8XkrTdIEsfotp+5AA5PAZVVxnsiTjnSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)