UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WfJuRNYwIw+dSPQQejfI9HEgUTcttBs8YNAPZk3myQI=' 
WHERE 
  key_id = '5cf154d3413531a29b042b981c0a2831130577aa1b7eb4783cc5b656fd75e0c6' 
  AND (
    token = 'WfJuRNYwIw+dSPQQejfI9HEgUTcttBs8YNAPZk3myQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018