UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dCwP4J0Avs4goWdG94RadSVBaIOaQn0Yv5WdJQ1i1iE=' 
WHERE 
  key_id = '8dcd2a7c36a5787f711d875f25d2e070ceda3c0a189399060a0034403973ba2b' 
  AND (
    token = 'dCwP4J0Avs4goWdG94RadSVBaIOaQn0Yv5WdJQ1i1iE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037