UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GR3UiQCVpXtA4aIxWzNpNxqgJeoITiQc9Uc/wt5K/0k=' 
WHERE 
  key_id = 'f76bf37654c8dde1e5d03ea7cef1433d452ad7c4da63f28a3f4753a5361c32ef' 
  AND (
    token = 'GR3UiQCVpXtA4aIxWzNpNxqgJeoITiQc9Uc/wt5K/0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039