UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mXumxpjDwGCRLKi5F/4n4GbrzuTD0GmlZRGDPVekVcM=' 
WHERE 
  key_id = '61dd011f53a17945bc5cca2732d571af8439822994ec779efaf53d1540a58177' 
  AND (
    token = 'mXumxpjDwGCRLKi5F/4n4GbrzuTD0GmlZRGDPVekVcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026