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

Query time 0.00055