UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XUf32dKcdEj8f2DV1RURPGBoqvGXhqcFBggFC4O3dKc='
WHERE
key_id = '61261c19cca71e5e866283980b2dc4c3ec0aad7c046967d541b192de23a8c352'
AND (
token = 'XUf32dKcdEj8f2DV1RURPGBoqvGXhqcFBggFC4O3dKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)