UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oWs4M+aK1D3omUfoLdFBkwyJwq07R/pPq9c2st0gpXI=' 
WHERE 
  key_id = 'cab1fbc8026e328405dd3b82f3379f8c8e322345d40b9f413f371893162e6bf6' 
  AND (
    token = 'oWs4M+aK1D3omUfoLdFBkwyJwq07R/pPq9c2st0gpXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033