UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5NyMRqWHNWrFord/8MgDoozzd7tbQy+GyrF6OxgEf/s='
WHERE
key_id = 'e2930c289d49cd89f7e116dc823abc590941dba7788376332efecba6b54cfc3c'
AND (
token = '5NyMRqWHNWrFord/8MgDoozzd7tbQy+GyrF6OxgEf/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)