UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pXfP2Qo2W9KIXwbkGKAWsKqn437IhF1/VzSalN14lo8='
WHERE
key_id = '1b70f77e694e82d133ef64d52e944fffac4bfdd65674750c5078c0a4dd29b4e9'
AND (
token = 'pXfP2Qo2W9KIXwbkGKAWsKqn437IhF1/VzSalN14lo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)