UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mtZZ6o+6YqF+a9yfOpGMOqxKZWoFmzqFJ5MRTTDsXU0=' 
WHERE 
  key_id = '6934943e31decdeb0f6c10e8d4d168b7040851b83118fd7bf6b8ee2f6e880246' 
  AND (
    token = 'mtZZ6o+6YqF+a9yfOpGMOqxKZWoFmzqFJ5MRTTDsXU0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016