UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nKrtqW8yjwN1D4JedHgD4Am5Oh9311Wxyll6BH06k1U=' 
WHERE 
  key_id = 'ec06f67f2d9a75781ecf2a5f4e233257faeedd70cdcc206fcc9cfb4275f7f1b2' 
  AND (
    token = 'nKrtqW8yjwN1D4JedHgD4Am5Oh9311Wxyll6BH06k1U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031