UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pV4px/Rv2zvGmjeOl6Gy4eHoN/c3ZHwXLmsAvqsyP0A=' 
WHERE 
  key_id = 'a3fa5a23ebea4e28535585aec5a326cc1bd3963bf6c00b94634a2ede2d38257b' 
  AND (
    token = 'pV4px/Rv2zvGmjeOl6Gy4eHoN/c3ZHwXLmsAvqsyP0A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037