UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lcm/jV3dBYwvez9cbQjSqD8fD8KN7MlKtq1b0sW3KAo='
WHERE
key_id = 'e0bdd0fcfa52b783a6a59b0ac4cb64e4860b0b1771bff4a2e8332548dadad429'
AND (
token = 'lcm/jV3dBYwvez9cbQjSqD8fD8KN7MlKtq1b0sW3KAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)