UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jKV2T2C7wbZjYBE5LJr9+0SlKOhJE06y4ZLbh11J+ts='
WHERE
key_id = '95f65289f101f41bc833a2a11fd8f50bff770e4c8318b952b6a9c86e8291e510'
AND (
token = 'jKV2T2C7wbZjYBE5LJr9+0SlKOhJE06y4ZLbh11J+ts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)