UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cpG4NpfxLsbOlbtdRBwkIRaAvm0yPr2DQAx7z5sqBik=' 
WHERE 
  key_id = '0cce8988f0da8781bec24d431e52290a5f990714636a06706d0ac6c3cfcf43b2' 
  AND (
    token = 'cpG4NpfxLsbOlbtdRBwkIRaAvm0yPr2DQAx7z5sqBik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030