UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bQevUQSpIo05AoO6CUIqHbzw3Wo6a06cOiUYSeU/KAg=' 
WHERE 
  key_id = '17a10c9ef00fc1d991da2f952cd7d19c31e8ed5b8b83aff8dbfcece122604054' 
  AND (
    token = 'bQevUQSpIo05AoO6CUIqHbzw3Wo6a06cOiUYSeU/KAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032