UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7oBHos50eKFXMk7KR4dK7x0NM6Z8+Qs94sLHxgYGr8A='
WHERE
key_id = 'c0cf6bd18765f615ed9492d9b59294cbc52a03a1695f6a82280eaad898ee9576'
AND (
token = '7oBHos50eKFXMk7KR4dK7x0NM6Z8+Qs94sLHxgYGr8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)