UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xpHuwQOwCdeHgMfhm1gUDv8odehCJQI7x7bF1O/8pII='
WHERE
key_id = 'df05e140d9c32d1b2f741c816342f42f7232210541905c0459b6b64d01252fdf'
AND (
token = 'xpHuwQOwCdeHgMfhm1gUDv8odehCJQI7x7bF1O/8pII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)