UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7UsqIVCiVCfUjpYH+mFGDYC1UL2DXmIMzLHYZUrFquM=' 
WHERE 
  key_id = '67019fea79c1931ddaeb03e6f1dfae6e5b034930162d9978401e44a4ee78550e' 
  AND (
    token = '7UsqIVCiVCfUjpYH+mFGDYC1UL2DXmIMzLHYZUrFquM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030